-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: to_numeric for numeric dtypes #12777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lgtm. ping on green. |
|
@sinhrks this looked fine. can you just rebase (I think this was sent when codecov was misbehaving). |
we can push this as well, lmk. |
Current coverage is 83.91%@@ master #12777 diff @@
==========================================
Files 136 136
Lines 49918 49931 +13
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 41885 41899 +14
+ Misses 8033 8032 -1
Partials 0 0
|
@jreback Current master has following issues. I've updated the PR to included the fixes. 1.
|
tm.assert_index_equal(res, pd.Index(idx.asi8, name='xxx')) | ||
|
||
# ToDo: enable when we can support native PeriodDtype | ||
# res = pd.to_numeric(pd.Series(idx, name='xxx')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoided to use is_period_array
ATM. we can have faster impl when period dtype is added.
elif getattr(arg, 'ndim', 1) > 1: | ||
raise TypeError('arg must be a list, tuple, 1-d array, or Series') | ||
else: | ||
values = arg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will fail with a scalar (though that might be another issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently it fails on master. Will include the fix.
pd.to_numeric(1)
# ValueError: Buffer has wrong number of dimensions (expected 1, got 0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gr8!. I think there might be an issue about this somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a separate issue.
Added scalar impl and tests ( |
thanks! |
git diff upstream/master | flake8 --diff
Skip
object
conversion if input is numeric already.